<?php
define('HEADCHAR','Content-type:text/html; charset=utf-8');
require('common.php');
/*****************************************/
/*				 初始变量				 */
/*****************************************/
$m=getgpc('m');
$a=getgpc('a');
$m=empty($m)?'index':$m;
$a=empty($a)?'index':$a;
if (in_array($m,array('index',''),TRUE)) {
	if (is_file(ROOT.'model/common/'.$m.'.php')) {
		require(ROOT.'model/common/'.$m.'.php');
	}
	if (is_file(ROOT.'model/web/'.$m.'.php')) {
		require(ROOT.'model/web/'.$m.'.php');
	} else {
		exit('Module not found!');
	}
	$m.='_module';
	$_ENV['HOME']['model']=$m::getInstance();
	$method='on'.$a;
	if (method_exists($_ENV['HOME']['model'],$method) && $a{0}!='_') {
		$_ENV['HOME']['model']->$method();
	} else {
		exit('Action not found!');
	}
} else {
	exit('Module not found!');
}
?>